﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSharp
{
    class WayInfo
    {
        NodeInfo nd_id, ndf;
        int way_id;
        string way_name;
        List<NodeInfo> nds = new List<NodeInfo>();
        List<List<NodeInfo>> ways_lst = new List<List<NodeInfo>>();
        
        public WayInfo(int id, List<int> m, string fname, string way_n)
        {
            way_id = id;
            way_name = way_n;
            foreach (int i in m)
            {
                nd_id = new NodeInfo(i, fname);
                nds.Add(nd_id);
            }
            
        }

        public List<NodeInfo> waynds()
        {
            return nds;
        }

        public List<Edge> CreateEdges(List<NodeInfo> n)
        {
            List<Edge> ed = new List<Edge>();
            int c = n.Count;
            for (int i = 0; i < c - 1; i++)
            {
                Edge e = new Edge(n.ElementAt(i), n.ElementAt(i+1));
                ed.Add(e);
            }

            return ed;
        }


        public void FindInter(ref List<List<NodeInfo>> x, List<NodeInfo> n)
        {
            x.Add(n);
        }
    }
}